
import javax.swing.table.AbstractTableModel;

class MyTableModel extends AbstractTableModel 
{
    private String[] columnNames;
    private Object[][] rowData;
    
    public MyTableModel(String[] columnNames, Object[][] rowData)
    {
        this.columnNames = columnNames;
        this.rowData = rowData;
    }
        
    @Override
    public String getColumnName(int col) 
    {
        return columnNames[col].toString();
    }
    @Override
    public int getRowCount() 
    { 
        return rowData.length; 
    }
    @Override
    public int getColumnCount() 
    { 
        return columnNames.length; 
    }
    @Override
    public Object getValueAt(int row, int col) 
    {
        return rowData[row][col];
    }
    @Override
    public boolean isCellEditable(int rowIndex, int columnIndex) 
    {
        if (columnIndex > 3)
        {
            return true;
        }
        return false;
    }
    public void removeRow(int row)
    {
        rowData = new Object[0][0];
    }
}